package com.auxgroup.smarthome.inner.dto;

import com.auxgroup.smarthome.entity.AbstractGenericEntity;
import com.auxgroup.smarthome.inner.entity.AppVersionEntity;

public class AppVersionDto extends AbstractGenericEntity {

    private String version;

    private Integer build;

    private String link;

    private String name;

    private String description;

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public Integer getBuild() {
        return build;
    }

    public void setBuild(Integer build) {
        this.build = build;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public AppVersionDto() {
    }

    public AppVersionDto(String version, int build, String link, String name, String description) {
        this.version = version;
        this.build = build;
        this.link = link;
        this.name = name;
        this.description = description;
    }

    public AppVersionEntity createAppVerion(AppVersionDto appVersionDto) {
        AppVersionEntity appVersionEntity = new AppVersionEntity();
        appVersionEntity.setBuild(appVersionDto.getBuild());
        appVersionEntity.setDescription(appVersionDto.getDescription());
        appVersionEntity.setLink(appVersionDto.getLink());
        appVersionEntity.setName(appVersionDto.getName());
        appVersionEntity.setVersion(appVersionDto.getVersion());
        return appVersionEntity;
    }

    public AppVersionEntity updateAppVersion(AppVersionEntity appVersionEntity) {
        appVersionEntity.setVersion(this.version);
        appVersionEntity.setName(this.name);
        appVersionEntity.setLink(this.link);
        appVersionEntity.setDescription(this.description);
        appVersionEntity.setBuild(this.build);
        return appVersionEntity;
    }
}
